<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
    <script>
        window.hdjs = {};
        window.hdjs.base = '../';
        window.hdjs.uploader = 'php/uploader.php?';
        window.hdjs.filesLists = 'php/filesLists.php?';
    </script>
    <script src="../require.js"></script>
    <script src="../config.js"></script>
</head>
<body style="padding: 50px;">
<button onclick="get()" class="btn btn-success">GET请求</button>
<button onclick="post()" class="btn btn-success">POST请求</button>
<script>
    require(['bootstrap']);
    function get() {
        require(['hdjs'], function (hdjs) {
            hdjs.ajax({
                type: 'get',
                url:'php/ajax.php',
                data: {id: 22, name: 'hdjs'},
                successUrl: 'http://hdjs.hdphp.com'
            })
        });
    }
    function post() {
        require(['hdjs'], function (hdjs) {
            hdjs.ajax({
                url:'php/ajax.php',
                data: {id: 22, name: 'hdjs'}
            })
        });
    }
</script>
</body>
</html>